/*
 * =====================================================================================
 *
 *       Filename:  rule.h
 *
 *    Description:  Class for shape rule
 *
 *        Version:  1.0
 *        Created:  30/06/12 14:00:49
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Moos Hueting (mh), mooshueting@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef _RULE
#define _RULE

#include "segment.h"
#include "segmentLibrary.h"
#include <iostream>

class Rule {
    Segment input;
    Segment output;
    bool final;
    bool initial;
public:
//    Rule(Segment in, Segment out) : input(in), output(out) {};
    Rule(SegmentLibrary lib); // generate rule at random from library

    bool isFinal() { return final; }
    bool isInitial() { return initial; }
    
    bool appliesTo();

    void printRule(); // print rule to std::cout

    void setFinal() { final = true; }
    void setInitial() { initial = true; }

    void setXT(int xt) { output.setX(xt); }
    void setYT(int yt) { output.setY(yt); }

    Segment getInput() { return input; }
    Segment getOutput() { return output; }

};

#endif
